package com.zx.link.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.BlobTypeHandler;

/**
 * @version v1.0
 * @Project: link
 * @Title: Link
 * @Description: 网络连接
 * @author: zhangx
 * @date: 2017年3月1日 上午11:35:48
 * @company: webyun
 * @Copyright: Copyright (c) 2017
 */
@Accessors(chain = true)
@TableName("li_link")
public class Link implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    private String name;

    private Integer tid;

    //	@TableField(jdbcType = JdbcType.BLOB)
    @TableField(typeHandler = BlobTypeHandler.class)
    private byte[] icon;

    private String url;

    /**
     * 是否已经被删除（逻辑删除），默认=0，1=被删除
     */
    private Integer isRemove;

    private String decription;

    private String userName;

    private String password;

    public static long getSerialversionuid() {
        return serialVersionUID;
    }

    /****************************getter***********************************/
    public Integer getId() {
        return id;
    }

    /****************************setter***********************************/
    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        if (name == null) {
            return "";
        }
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getTid() {
        if (name == null) {
            return 1;
        }
        return tid;
    }

    public void setTid(Integer tid) {
        this.tid = tid;
    }

    public byte[] getIcon() {
        return icon;
    }

    public void setIcon(byte[] icon) {
        this.icon = icon;
    }

    public String getUrl() {
        if (url == null) {
            return "";
        }
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getIsRemove() {
        if (isRemove == null) {
            return 0;
        }
        return isRemove;
    }

    public void setIsRemove(Integer isRemove) {
        this.isRemove = isRemove;
    }

    public String getDecription() {
        if (decription == null) {
            return "";
        }
        return decription;
    }

    public void setDecription(String decription) {
        this.decription = decription;
    }

    public String getUserName() {
        if (userName == null) {
            return "";
        }
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        if (password == null) {
            return "";
        }
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String toJSON() {
        return "{\"id\":" + id + ", \"name\":\"" + name + "\", \"_parentId\":" + tid + ", \"icon\":\"" + icon
                + "\", \"url\":\""
                + url + "\", \"isRemove\":" + isRemove + ", \"decription\":\"" + decription
                + "\", \"userName\":\"" + userName + "\",\"password\":\"" + password + "\"}";
    }

    @Override
    public String toString() {
        return "Link [id=" + id + ", name=" + name + ", tid=" + tid + ", icon=" + icon + ", url=" + url + ", isRemove="
                + isRemove + ", decription=" + decription + ", userName=" + userName + ", password=" + password + "]";
    }


}
